package com.sjr.easy.chat.app.config;

import com.sjr.easy.chat.app.interceptor.AppLoginStatusInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AppInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private AppLoginStatusInterceptor appLoginStatusInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(appLoginStatusInterceptor).order(Ordered.HIGHEST_PRECEDENCE);
    }
}
